package com.zyong.design.pattern.command.case1;

/**
 * @program: zyong-design-pattern
 * @ClassName: ConcreteCommand
 * @author: zyong
 * @create: 2024-03-25 23:56
 */
public class ConcreteCommand implements Command {
    private Receiver receiver;

    public ConcreteCommand(Receiver receiver) {
        this.receiver = receiver;
    }

    @Override
    public void execute() {
        receiver.action();
    }

    @Override
    public void undo() {
        receiver.unAction();
    }
}
